﻿using System;
using System.Linq;

class Program
{
    static void Main()
    {
        Random random = new Random();
        var numbers = Enumerable.Range(0, 100)
                                .Select(i => random.Next(0, 1001)) // Next方法的第二个参数不包含，使用1001
                                .OrderByDescending(n => n)
                                .ToList();

        int sum = numbers.Sum();
        double average = numbers.Average();

        Console.WriteLine("排序后的数字：");
        foreach (var number in numbers)
        {
            Console.Write(number + " ");
        }
        Console.WriteLine();

        Console.WriteLine($"总和: {sum}");
        Console.WriteLine($"平均数: {average}");
    }
}
